{% extends TEMPLATE_BASE %}
{% block title %}Statistics{% endblock %}

{% block content %}
<h1>Elections</h1>

<p>
<form method="get" action="{% url "stats@elections" %}">
<b>search</b>: <input type="text" name="q" value="{{q}}"/> 
<input class="small button" type="submit" value="search" /> <a class="small button" href="?">clear search</a>
</form>
</p>


<p>
{% if elections_page.has_previous %}
<a href="?page={{elections_page.previous_page_number}}&limit={{limit}}&q={{q|urlencode}}">previous {{limit}}</a> &nbsp;&nbsp;
{% endif %}

Elections {{elections_page.start_index}} - {{elections_page.end_index}} (of {{total_elections}})&nbsp;&nbsp;

{% if elections_page.has_next %}
<a href="?page={{elections_page.next_page_number}}&limit={{limit}}&q={{q|urlencode}}">next {{limit}}</a> &nbsp;&nbsp;
{% endif %}
</p>

{% for election in elections %}
<p>
<b><a href="{% url "election@view" election.uuid %}">{{election.name}}</a></b> by <a href="mailto:{{election.admin.info.email}}">{{election.admin.pretty_name}}</a> -- {{election.num_voters}} voters / {{election.num_cast_votes}} cast votes
</p>
{% endfor %}

{% endblock %}
